import Book.*;
import User.*;

import java.util.Scanner;

public class Test {
    public static User log() {
        System.out.println("请输入你的姓名：");
        Scanner s = new Scanner(System.in);
        String name = s.nextLine();
        System.out.println("请输入你的身份： 1：管理员   2：普通用户");
        int id = s.nextInt();
        System.out.println("欢迎"+name+"来到图书管理系统");
        if(id==1) {
            return new Admin(name);
        } else if(id==2) {
            return new NormalUser(name);
        } else {
            System.out.println("输入错误，请重新输入！");
            return null;
        }


    }
    public static void main(String[] args) {

        Bookshelf bookshelf = new Bookshelf();
        User user = log();

        while(true) {

            int option =  user.menu();
            user.doOperation(option,bookshelf);

        }


    }
}
